package com.study.think.node_08.Test_01;

/**
 * Created by 赵超 on 2017/3/9.
 */
public class Test {
    public static void main(String[] args) {
        //创建三个子类对象
        Unicycle unicycle = new Unicycle();
        unicycle.setName("unicycle");

        Bicycle bicycle = new Bicycle();
        bicycle.setName("bicycle");

        Tricycle tricycle = new Tricycle();
        tricycle.setName("tricycle");


        //测试
        Cycle.ride(unicycle);
        Cycle.ride(bicycle);
        Cycle.ride(tricycle);

        //向上转型
        Cycle cycle1 = new Unicycle();
        Cycle cycle2 = new Bicycle();
        Cycle cycle3 = new Tricycle();
    }
}
